package com.wenchao.jetpackdemo;

import android.content.Intent;
import android.os.Bundle;

import androidx.appcompat.app.AppCompatActivity;

import com.wenchao.jetpackdemo.camerax.CameraXActivity;
import com.wenchao.jetpackdemo.dataBinding.DataBindingActivity;
import com.wenchao.jetpackdemo.databinding.ActivityMainBinding;
import com.wenchao.jetpackdemo.navigation.NavigationActivity;
import com.wenchao.jetpackdemo.paging.PagingActivity;
import com.wenchao.jetpackdemo.viewpager2.Viewpager2Activity;

/**
 * @author zhangwenchao
 */

public class MainActivity extends AppCompatActivity {

    private ActivityMainBinding binding;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        binding = ActivityMainBinding.inflate(getLayoutInflater());
        setContentView(binding.getRoot());

        binding.btnPaging.setOnClickListener(view ->
                startActivity(new Intent(this, PagingActivity.class)));

        binding.btnViewpager2.setOnClickListener(view ->
                startActivity(new Intent(this, Viewpager2Activity.class)));

        binding.btnNavigation.setOnClickListener(view ->
                startActivity(new Intent(this, NavigationActivity.class)));

        binding.btnDataBinding.setOnClickListener(view ->
                startActivity(new Intent(this, DataBindingActivity.class)));

        binding.btnCamerax.setOnClickListener(view ->
                startActivity(new Intent(this, CameraXActivity.class)));
    }

}